package NGUYENVANDOAN.EXAM01.BAITOAN02;

public class TestApplication {

    /**
     * @param args
     */
    public static void main(String[] args) {
        Students objSV1 = new Students();
        Students objSV2 = new Students();
        Students objSV3 = new Students();
        Students objSV4 = new Students();
        Students objSV5 = new Students();

        // SV1
        objSV1.setRollNo("100");
        objSV1.setFullName("Nguyễn Văn A");
        objSV1.setSex(true);
        objSV1.setEmail("a@gmail.com");
        objSV1.setMobile("0914123451");
        objSV1.setAddress("số 1 đường Hàng Bài");
        objSV1.setMark(4);

        // SV2
        objSV2.setRollNo("200");
        objSV2.setFullName("Nguyễn Văn B");
        objSV2.setSex(true);
        objSV2.setEmail("b@gmail.com");
        objSV2.setMobile("0914123452");
        objSV2.setAddress("số 2 đường Hàng Bài");
        objSV2.setMark(4);

        // SV3
        objSV3.setRollNo("300");
        objSV3.setFullName("Nguyễn Văn C");
        objSV3.setSex(true);
        objSV3.setEmail("c@gmail.com");
        objSV3.setMobile("0914123453");
        objSV3.setAddress("số 3 đường Hàng Bài");
        objSV3.setMark(7.5);

        // SV4
        objSV4.setRollNo("400");
        objSV4.setFullName("Nguyễn Thị D");
        objSV4.setSex(false);
        objSV4.setEmail("d@gmail.com");
        objSV4.setMobile("0914123454");
        objSV4.setAddress("số 4 đường Hàng Bài");
        objSV4.setMark(6.5);

        // SV5
        objSV5.setRollNo("500");
        objSV5.setFullName("Nguyễn Thị E");
        objSV5.setSex(false);
        objSV5.setEmail("e@gmail.com");
        objSV5.setMobile("0914123455");
        objSV5.setAddress("số 5 đường Hàng Bài");
        objSV5.setMark(10);

        StudentController objController = new StudentController();

        String result = objController.PrintStudentInfo(objSV1);
        String result2 = objController.PrintStudentInfo(objSV2);
        String result3 = objController.PrintStudentInfo(objSV3);
        String result4 = objController.PrintStudentInfo(objSV4);
        String result5 = objController.PrintStudentInfo(objSV5);

        String rank = objController.CheckMarks(objSV1);
        String rank1 = objController.CheckMarks(objSV2);
        String rank3 = objController.CheckMarks(objSV3);
        String rank4 = objController.CheckMarks(objSV4);
        String rank5 = objController.CheckMarks(objSV5);

        boolean compare = objController.CompareTo(objSV1, objSV2);
        boolean compare1 = objController.CompareTo(objSV3, objSV5);
        boolean compare2 = objController.CompareTo(objSV1, objSV4);

        System.out.println("--------Student 1-------");
        System.out.println(result);
        System.out.println("Xếp loại: " + rank1);

        System.out.println();
        System.out.println("--------Student 2-------");
        System.out.println(result2);
        System.out.println("Xếp loại: " + rank1);

        System.out.println();
        System.out.println("--------Student 3-------");
        System.out.println(result3);
        System.out.println("Xếp loại: " + rank3);

        System.out.println();
        System.out.println("--------Student 4-------");
        System.out.println(result4);
        System.out.println("Xếp loại: " + rank4);

        System.out.println();
        System.out.println("--------Student 5-------");
        System.out.println(result5);
        System.out.println("Xếp loại: " + rank5);

        System.out.println();
        System.out.println("Compare Student 1 and Student 2");
        System.out.println(compare);
        System.out.println("Compare Student 3 and Student 5");
        System.out.println(compare1);
        System.out.println("Compare Student 1 and Student 4");
        System.out.println(compare2);
    }
}
